package com.lantosec.hmrp.modules.category.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsAccessVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 资产门禁设备 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsAccess extends BaseEntity<AssetsAccessVO> {

    private static final long serialVersionUID = 1L;
    public AssetsAccess(AssetsAccessVO vo){
        this.accessId = vo.getAccessId();
        this.accessName = vo.getAccessName();
        this.listenerPort = vo.getListenerPort();
        this.warnInterval = vo.getWarnInterval();
        this.flag = vo.getFlag();
    }

    @Override
    public AssetsAccessVO convertToVO(){
        return new AssetsAccessVO(this);
    }


    /**
     * 门禁设备ID
     */
    @TableId(value = "access_id", type = IdType.ASSIGN_UUID)
    private String accessId;

    /**
     * 门禁设备名称
     */
    private String accessName;

    /**
     * 监听端口
     */
    private Integer listenerPort;

    /**
     * 预警间隔时间(分钟)
     */
    private Integer warnInterval;

    @TableField(exist = false)
    private Integer flag;


    public enum ColName {
        access_id, access_name, listener_port, warn_interval, 
    }
}
